import { createBrowserRouter, Navigate } from "react-router-dom";
import Login from "../views/login";
import Welcome from "../views/welcome";
import LayoutCon from "../layout";
import Dept from "../views/dept";
import Role from "../views/role";
import MenuCompnent from "../views/menu";
import Dashboard from "../views/dashboard";
import User from "../views/user";
const router = createBrowserRouter([
  {
    element: <LayoutCon />,
    children: [
      {
        path: "/welcome",
        element: <Welcome />,
      },
      {
        path: "/dashboard",
        element: <Dashboard />,
      },
      {
        path: "/deptList",
        element: <Dept />,
      },
      {
        path: "/userList",
        element: <User />,
      },
      {
        path: "/menuList",
        element: <MenuCompnent />,
      },
      {
        path: "/roleList",
        element: <Role />,
      },
    ],
  },
  {
    path: "/",
    element: <Navigate to={"/welcome"} />,
  },
  {
    path: "/login",
    element: <Login />,
  },
]);

export default router;
